package client.pojo;

import java.io.Serializable;
public class Message implements Serializable {

    private int id;
    /**
     * 0：聊天内容
     * 1：用户加入通知
     * 2: 历史消息
     */
    private int type;
    private String userName;
    private String content;
    private String sendTime;

    public Message(String userName, String content, String sendTime) {
        this.userName = userName;
        this.content = content;
        this.sendTime = sendTime;
    }

    public Message() {
    }

    public Message(int id, String userName, String content, String sendTime) {
        this.id = id;
        this.userName = userName;
        this.content = content;
        this.sendTime = sendTime;
    }

    public Message(String userName, String content, String sendTime,int type) {
        this.userName = userName;
        this.content = content;
        this.sendTime = sendTime;
        this.type = type;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }


    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }


    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }


    public String getSendTime() {
        return sendTime;
    }

    public void setSendTime(String sendTime) {
        this.sendTime = sendTime;
    }

    @Override
    public String toString() {
        return "Message{" +
                "id=" + id +
                ", type=" + type +
                ", userName='" + userName + '\'' +
                ", content='" + content + '\'' +
                ", sendTime=" + sendTime +
                '}';
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }
}
